<template>
    <div class="process-monitoring-box">
        <commpVxeTable
        :key="tableKey"
         :isCanWrap="true"
         :occupancyHeight="occupancyHeight"
         :config="dataTableConfig"
         :columns="columnsVxe"
         :formItem="formItem"
         :searchType="true"
         :tablePadding="tablePadding"
         ref="acceptanceRegistrationRef"
         >
            <template v-slot:fsxmc_name="{row}" data-desc="自定操作栏">
                <span v-if="row.flcsfkb == '不可办'" class="fsxmcQ-c-t">[等待中]</span>
                <span v-if="row.fzwxtbzzt == '提前办'" class="fsxmcQ-l-t">[优先办]</span>

                <!-- <span v-if="row.fzwxtzgzt == '整改中'" class="fsxmcQ-c-t">[{{ row.fzwxtzgzt }}]</span>
                <span v-if="row.fzwxtzgzt == '已整改'" class="fsxmcQ-l-t">[{{ row.fzwxtzgzt }}]</span>

                <span v-if="row.fzwxtcjzt == '撤件回复'" class="fsxmcQ-h-t" @click="cjhfClick()">[{{ row.fzwxtcjzt }}]</span>
                <span v-if="row.fzwxtcjzt == '撤件审核中'" class="fsxmcQ-c-t">[{{ row.fzwxtcjzt }}]</span>
                <span v-if="row.fzwxtcjzt == '已撤件'" class="fsxmcQ-l-t">[{{ row.fzwxtcjzt }}]</span> -->

                <span v-if="row.fzwxtthzt" class="fsxmcQ-h-t">{{ row.fzwxtthzt }}</span>
                <a href="#" @click="handleClick(row)">{{ row.fsxmc }}</a>
            </template>
            <template v-slot:name_fslsj="{row}" data-desc="自定操作栏">
                <span>{{ timeProcessing(row.fslsj) }}</span>
            </template>
            <template v-slot:name_ffssj="{row}" data-desc="自定操作栏">
                <span>{{ row.ffssj }}</span>
            </template>
            <template v-slot:fhjmc_default="{row}" >
                {{ row.fhjmc == '补齐补正'?'待补正':(row.fhjmc == '整改材料'?'待整改':row.fhjmc) }}
            </template>
            <template v-slot:operation_btn="{row}">
                <a-form layout="inline" class="search-form" >
                    <a-form-item v-if="row.fhjmc !== '办结'">
                        <a-button class="blue-btn" type="primary" @click="handleClick(row)" icon="edit">{{ row.fhjmc == '补齐补正'?'补正':(row.fhjmc == '整改材料'?'整改':'办理') }}</a-button>
                    </a-form-item>
                </a-form>
            </template>
        </commpVxeTable>
        <increase ref="increaseRef" @successReturn="successReturn" />
    </div>
</template>
<script>
import assessCheckApi from './service/api'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import blobType from '@/common/blobType'
import moment from 'moment'
import increase from './increase.vue'
// import {
//     queryJobByJobIdServe,
//     getSqsxBm,
//     spcyGetJobConcernByJobId,
//     spcydelRwdjJob,
// } from './service/index'
export default {
    components:{
        commpVxeTable,
        increase,
    },
    props:{
        occupancyHeight: {
            type: Number,
            default: 0,
            require: false,
            
        },
        tablePadding: {
            type: String,
            default: '',
            require: false,
            
        },
    },
    data(){
        return{
            tableKey:null,
            formItem:[{
                label: '关键字',
                model: 'sxcxgjz',
                searchType:'展开',
            },{
                label: '事项名称',
                model: 'fsxmc',
                searchType:'收起',
            },{
                label: '企业名称',
                model: 'fqymc',
                searchType:'收起',
            }],//rangePicker
            columnsVxe:[
            {
                type: 'checkbox',
                width: 60 ,
                fixed: 'left'
            },{
                title: '事项名称', //列头显示文字
                field: 'fsxmc',
                align:'left',
                slots: {
                    default: 'fsxmc_name',
                },
                sortable:true,//排序
                // titleInterval:true,//两个字间隔
            },{
                title: '企业名称', //列头显示文字
                field: 'fqymc',
            },{
                title: '任务编号',
                field: 'fslbh',
                width:90,
            },{
                title: '数据核对码',
                field: 'fsqdbh',
                width:196,
            },{
                title: '发送时间',
                field: 'ffssj',
                // slots: {
                //     // 使用插槽模板渲染
                //     default: 'name_fslsj',
                // },
                width:160,
            },
            {
                title: '办理状态',
                field: 'fhjmc',//补齐补正、整改材料、技术审评
                slots: {
                    // 使用插槽模板渲染
                    default: 'fhjmc_default',
                },
                width:96,
            },
            {
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                fixed: 'right',
                width:90
            }],
            dataTableConfig:{
                api: assessCheckApi.list,
                rowId: 'jobid',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                paramet:{
                    // onlyCurrentUser:false,
                    // fblzt:'待办'
                }
            },
        }
    },
    watch:{

    },
    mounted(){

    },
    methods:{
        cjhfClick(){
            this.$route.push('/enterpriseWithdrawalApplication/index')
        },
        timeProcessing(val){
            if(val){
                val = val.slice(0,11)
            }
            return val
        },
        handleClick(row){
            //console.log(row)
            this.$refs.increaseRef.getData(row)
        },
        addInspectionTaskSuccess(){
            this.successReturn()
        },
        successReturn(){
            this.$refs.acceptanceRegistrationRef.searchEvent()
        },
    }
}
</script>
